package com.heima.dynamic_sql.controller;

import com.heima.dynamic_sql.entity.User;
import com.heima.dynamic_sql.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auth: zhuan
 * @Desc: 用户模块控制器
 * @Date: 2022-03-20 15:21:46
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/findAll")
    public List<User> findAll(){
        List<User> all = userMapper.findAll();
        return all;
    }
}
